package com.ruoyi.system.config;

import cn.hutool.extra.spring.SpringUtil;
import com.pingan.openbank.api.sdk.client.ApiClient;
import com.ruoyi.account.util.PaPayUtil;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class test {

    public volatile static ApiClient apiClient;

    public static void main(String[] args) {


        Properties properties = new Properties();
        try {
            InputStream inputStream = test.class.getClassLoader().getResourceAsStream("conf/configTest.properties");
            if (inputStream != null) {
                properties.load(inputStream);
                System.out.println("配置文件加载成功");
                getInstance();
            } else {
                System.out.println("配置文件未找到");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public static ApiClient getInstance() {
        if (apiClient == null) {
            synchronized (PaPayUtil.class) {
                if (apiClient == null) {
                        apiClient = ApiClient.getInstance("conf/configTest.properties");

                }
            }
        }
        return apiClient;
    }
}
